var attackFactory = argument0;
var attacker = argument1;
var cooldown = ds_map_find_value(attacker.attackCooldowns, attackFactory);
if (cooldown == 0 || cooldown + attackFactory.delay < current_time)
{
    ds_map_replace(attacker.attackCooldowns, attackFactory, current_time);
    return true;
}
return false;
